package com.itany.book.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itany.book.book.service.IBookService;
import com.itany.book.pojo.Book;
import com.itany.book.vo.ActionResult;
import com.itany.book.vo.ResponseResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * Created by tyh on 2018/9/23.
 */
@RestController
@RequestMapping("/testbook")
public class TestBookController {

    @Reference
    private IBookService bookService;

    @RequestMapping("/addDoc")
    public ActionResult addDoc(){
        ActionResult ac = new ActionResult();
        bookService.addDoc();
        ac.setStatus(0);
        return ac;
    }

    // @RequestMapping("/findDoc")
    // public ResponseResult findDoc(String keyword){
    //     System.out.println(keyword);
    //     List<Book> books = bookService.findDoc(keyword);
    //     return ResponseResult.success(books);
    //        // return bookService.findDoc(keyword);
    // }
}
